{% extends 'layout.html' %}
{% block title %}{{ station.station_name }}{% endblock %}
{% block content %}
<div class="row">
    <div class="col" align="center">
        <p><h3>{{station.station_name}}</h3></p>
        <form action="/channel_update/{{station.station_id}}/{{channel.channel_id}}/" method="POST" id="inspect_rule_create">
            {% csrf_token %}
            <input type="hidden" name="channel_id" value="{{channel.channel_id}}">
            <input type="hidden" name="aibox_sn" value="{{channel.aibox_sn.aibox_sn}}">
            <table class="table table-striped">
                <tr>
                    <td>监控通道序号</td>
                    <td>
                        <input class="form-control" name="channel_number" value="{{channel.channel_number}}" required>
                    </td>
                </tr>
                <tr>
                    <td>监控通道名称</td>
                    <td>
                        <input class="form-control" name="channel_name" value="{{channel.channel_name}}" required>
                    </td>
                </tr>
                <tr>
                    <td>监控通道IP</td>
                    <td>
                        <input class="form-control" name="channel_ip" value="{{channel.channel_ip}}" required>
                    </td>
                </tr>
                <tr>
                    <td>监控通道URL</td>
                    <td>
                        <input class="form-control" name="channel_url" value="{{channel.channel_url}}" required>
                    </td>
                </tr>
                <tr>
                    <td>视觉算法</td>
                    <td>
                        <select name="channel_algorithm" class="form-control" required>
                            <option>{{channel.channel_algorithm}}</option>
                            <option>区域入侵</option>
                            <option>烟雾火焰</option>
                            <option>机动车违停</option>
                            <option>安全帽佩戴</option>
                            <option>人员抽烟</option>
                            <option>蒙皮破损</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td><button type="reset" class="btn btn-danger btn-block">重置</button></td>
                    <td><button type="submit" class="btn btn-primary btn-block">提交</button></td>
                </tr>
            </table>
        </form>
        <script>
          $(document).ready(function() {
            $('#inspect_rule_create').validate();
          });
        </script>
    </div>
</div>
<div class="row">
    <div class="col" align="right">
        <a role="button" class="btn btn-danger" href="/channel_delete/{{station.station_id}}/{{channel.channel_id}}">删除通道</a>
    </div>
</div>
{% endblock %}